package com.Day1008;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Filter;
import java.util.stream.Collectors;

public class Text9 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(11);
        list.add(22);
        list.add(88);
        list.add(44);
        list.add(55);

        list.sort((Integer o1,Integer o2) -> {
            if (o1 < o2){
                return -1;
            }
            return 0;
        });
        list.forEach(entry -> {
            System.out.println(entry);
        });
        List<Integer> newlist = list.stream().filter(entry -> {
            if (entry > 30){
                return true;
            }
            return false;
        }).collect(Collectors.toList());
        System.out.println("过滤后的集合");
        System.out.println(newlist.size());
        newlist.forEach(e -> {
            System.out.print(e + " ");
        });
    }
}
